import { userInfoStore } from '@/stores/user'
import http from '@/utils/http.js'

export function getUserAuth() {
  return http({
    url: `/admin/api/user-verifications/status`,
    method: 'get'
  })
}

export function addUserAuth(data) {
  return http({
    url: `/admin/api/user-verifications`,
    method: 'post',
    data
  })
}

export function getFaceAuth() {
  return http({
    url: `/admin/api/face-verifications/status`,
    method: 'get'
  })
}

export function registerFace(data) {
  return http({
    url: `/admin/api/face/register`,
    method: 'post',
    params: {
      userId: userInfoStore().userInfo.userId
    },
    data
  })
}

export function verifyFace(data) {
  return http({
    url: `/admin/api/face/verify`,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
